<ul class="tabs" data-tabs="tabs">
    <?php $first = ' class="active"'; ?>
    <?php foreach ($languages as $lang => $desk): ?>
    <li<?php echo $first; ?>><a href="#tab-<?php echo $lang; ?>"><?php echo $lang; ?></a></li>
    <?php $first = ''; ?>
    <?php endforeach; ?>
</ul>

<div class="pill-content">
    <?php $first = ' class="active"'; ?>
    <?php foreach ($languages as $lang => $desk): ?>
    <div<?php echo $first; ?> id="tab-<?php echo $lang; ?>">
        <table>
            <tr>
                <th>string</th>
                <th>translation</th>
                <th></th>
            </tr>
            <?php if (count($strings[$lang]) < 1): ?>
            <tr>
                <td colspan="3">empty</td>
            </tr>
            <?php endif; ?>
            <?php foreach($strings[$lang] as $string => $translation) : ?>
            <form method="post">
                <input type="hidden" name="lang" value="<?php echo $lang; ?>" />
                <input type="hidden" name="old_string" value="<?php echo $string; ?>" />
                <tr>
                    <td>
                        <input class="span6" name="string" value="<?php echo $string; ?>" required />
                    </td>
                    <td>
                        <input class="span10" name="translation" value="<?php echo $translation; ?>" required />
                    </td>
                    <td>
                        <button name="save" value="true" class="btn primary">save</button>
                        <button name="remove" value="true" class="btn error">remove</button>
                    </td>
                </tr>
            </form>
            <?php endforeach; ?>
            <tr>
                <th colspan="3">create new</th>
            </tr>
            <form method="post">
                <input type="hidden" name="lang" value="<?php echo $lang; ?>" />
                <input type="hidden" name="old_string" value="" />
                <tr>
                    <td>
                        <input class="span6" name="string" required />
                    </td>
                    <td>
                        <input class="span10" name="translation" required />
                    </td>
                    <td>
                        <button name="save" value="true" class="btn primary">save</button>
                    </td>
                </tr>
            </form>
        </table>
    </div>
    <?php $first = ''; ?>
    <?php endforeach; ?>
</div>